<script>
export default {
  created () {
    // 调用API从本地缓存中获取数据
    /*
     * 平台 api 差异的处理方式:  api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
     * 微信：mpvue === wx, mpvuePlatform === 'wx'
     * 头条：mpvue === tt, mpvuePlatform === 'tt'
     * 百度：mpvue === swan, mpvuePlatform === 'swan'
     * 支付宝(蚂蚁)：mpvue === my, mpvuePlatform === 'my'
     */

    let logs
    if (mpvuePlatform === 'my') {
      logs = mpvue.getStorageSync({key: 'logs'}).data || []
      logs.unshift(Date.now())
      mpvue.setStorageSync({
        key: 'logs',
        data: logs
      })
    } else {
      logs = mpvue.getStorageSync('logs') || []
      logs.unshift(Date.now())
      mpvue.setStorageSync('logs', logs)
    }
  },
  log () {
    console.log(`log at:${Date.now()}`)
  }
}
</script>

<style>
.container {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 200rpx 0;
  box-sizing: border-box;
}
page{
  background: #f8f8f8;
}
.weui-btn-area {
  margin:1.1em 2.4em 1.1em 2.4em!important;
}
.weui-btn_primary{
  background: #FF787E!important;
  border-radius: 20px!important;
}
.mycard{
  margin:0.2em 0.8em;
}
.mycard .weui-cells{
  border-radius: 0.5em;
  box-shadow: 0px 0px 0.5em #eee;
}
.mycard .weui-cells:before,.mycard .weui-cells:after{
  display: none;
}
.weui-cells{
  margin-top: 0.5em!important;
}
.weui-cells.weui-cells_notop{
  margin-top: 0px!important;
}
.grey{
  color: #999;
}
.red{
  color: #E4393C;
}
.lightred{
  color: #FF787E;
}
.fs08{
  font-size: 0.8em;
}
.fs09{
  font-size: 0.9em;
}
/* this rule will be remove */
* {
  transition: width 2s;
  -moz-transition: width 2s;
  -webkit-transition: width 2s;
  -o-transition: width 2s;
}
</style>
